package com.rc.web.controller;

import com.rc.common.annotate.ApiLog;
import com.rc.pojo.dto.dto.AiChatDTO;
import com.rc.pojo.vo.aichat.AiChatVO;
import com.rc.web.service.AiChatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  控制层。
 *
 * @author 27806
 * @since 2024-06-24
 */
@RestController
@RequestMapping("/aiChat")
@Api(tags = "ai对话")
@RequiredArgsConstructor
public class AiChatController {
    private final AiChatService aiChatService;

    @PostMapping("/addBatch")
    @ApiOperation("保存用户对话")
    @ApiLog
    public void addBatch(@RequestBody List<AiChatDTO> dtoList) {
        aiChatService.addBatch(dtoList);
    }

    @GetMapping("/list")
    @ApiOperation("获取用户对话列表")
    public List<AiChatVO> getList() {
        return aiChatService.getList();
    }


}
